package com.example.util;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import java.io.Serializable;


/**
 * 统一返回结果集
 */
@Data
@AllArgsConstructor
@Builder
public class Result implements Serializable {
    //返回true or flase
    private boolean flag;
    //数据
    private Object data;
    //提示报错信息
    private String msg;
    //总条数
    private int total;
    public Result() {
    }
    public Result(boolean flag){
        this.flag=flag;
    }

    public Result(boolean flag, String msg) {
        this.flag = flag;
        this.msg = msg;
    }

    public Result(boolean flag, Object data, String msg) {
        this.flag = flag;
        this.data = data;
        this.msg = msg;
    }

    public Result(boolean flag, Object data) {
        this.flag = flag;
        this.data = data;
    }
    public Result(String msg) {
        this.flag = flag;
        this.msg = msg;
    }
}
